import { tabs, blank, page } from "@/layouts";
/**
 * 生成前端路由
 */
export const frontendRouter = [
  {
    path: "/",
    name: "root",
    component: tabs,
    meta: { title: "COZE", invisible: false, buttonLimit: [] },
    hidden: false,
    hideChildrenInMenu: false,
    redirect: "/home",
    children: [
      {
        path: "/home",
        name: "home",
        component: () => import("@/views/home/index"),
        meta: {
          title: "首页",
          icon: "home",
          buttonLimit: ["home_details"],
        },
      },
      // 多租户站点模块
      {
        path: "/tenantsModule",
        name: "tenantsModule",
        component: page,
        meta: {
          title: "多租户站点模块",
          icon: "dropbox",
          buttonLimit: [],
        },
        children: [
          {
            path: "/tenantsModule/tenants",
            name: "tenants",
            component: () => import("@/views/tenantsModule/tenants/index"),
            meta: {
              title: "多租户设定",
              buttonLimit: [
                "tenants_edit",
                "tenants_details",
                "tenants_delete",
                "tenants_create",
              ],
            },
          },
          {
            path: "/tenantsModule/project",
            name: "project",
            component: () => import("@/views/tenantsModule/project/index"),
            meta: {
              title: "项目设定",
              buttonLimit: [
                "project_edit",
                "project_details",
                "project_delete",
                "project_create",
              ],
            },
          },
          // {
          //   path: "/tenantsModule/website",
          //   name: "website",
          //   component: () => import("@/views/tenantsModule/website/index"),
          //   meta: {
          //     title: "站点设置",
          //     buttonLimit: [
          //       "website_edit",
          //       "website_details",
          //       "website_delete",
          //       "website_create",
          //     ],
          //   },
          // },
        ],
      },
      // 管理员模块
      {
        path: "/adminModule",
        name: "adminModule",
        component: page,
        meta: {
          title: "管理员模块",
          icon: "dropbox",
          buttonLimit: [],
        },
        children: [
          {
            path: "/adminModule/admin",
            name: "admin",
            component: () => import("@/views/adminModule/admin/index"),
            meta: {
              title: "管理员设置",
              buttonLimit: [
                "admin_edit",
                "admin_details",
                "admin_delete",
                "admin_create",
              ],
            },
          },
          // {
          //   path: "/adminModule/adminCenter",
          //   name: "adminCenter",
          //   component: () => import("@/views/adminModule/adminCenter/index"),
          //   meta: {
          //     title: "个人设置",
          //     icon: "idcard",
          //     buttonLimit: ["adminCenter_edit"],
          //   },
          // },
        ],
      },
      // 用户模块
      {
        path: "/userModule",
        name: "userModule",
        component: page,
        meta: {
          title: "用户模块",
          icon: "dropbox",
          buttonLimit: [],
        },
        children: [
          {
            path: "/userModule/user",
            name: "user",
            component: () => import("@/views/userModule/user/index"),
            meta: {
              title: "用户信息",
              buttonLimit: [
                "user_edit",
                "user_details",
                "user_delete",
                "user_create",
              ],
            },
          },
          {
            path: "/userModule/withdrawal",
            name: "withdrawal",
            component: () => import("@/views/userModule/withdrawal/index"),
            meta: {
              title: "用户提现申请",
              buttonLimit: [
                "withdrawal_edit",
                "withdrawal_details",
                "withdrawal_delete",
                "withdrawal_create",
              ],
            },
          },
          {
            path: "/userModule/rechargeHistory",
            name: "rechargeHistory",
            component: () => import("@/views/userModule/rechargeHistory/index"),
            meta: {
              title: "用户充值记录",
              buttonLimit: [
                "rechargeHistory_edit",
                "rechargeHistory_details",
                "rechargeHistory_delete",
                "rechargeHistory_create",
              ],
            },
          },
          {
            path: "/userModule/consumptionHistory",
            name: "consumptionHistory",
            component: () =>
              import("@/views/userModule/consumptionHistory/index"),
            meta: {
              title: "用户消费记录",
              buttonLimit: [
                "consumptionHistory_details",
                "consumptionHistory_export",
              ],
            },
          },
        ],
      },
      // 分销模块
      {
        path: "/saleModule",
        name: "saleModule",
        component: page,
        meta: {
          title: "分销模块",
          icon: "dropbox",
          buttonLimit: [],
        },
        children: [
          {
            path: "/saleModule/salehistory",
            name: "salehistory",
            component: () => import("@/views/saleModule/salehistory/index"),
            meta: {
              title: "分销员申请记录",
              buttonLimit: [
                "salehistory_edit",
                "salehistory_details",
                "salehistory_delete",
                "salehistory_create",
              ],
            },
          },
          {
            path: "/saleModule/saleapplyfor",
            name: "saleapplyfor",
            component: () => import("@/views/saleModule/saleapplyfor/index"),
            meta: {
              title: "分销记录历史",
              buttonLimit: [
                "saleapplyfor_edit",
                "saleapplyfor_details",
                "saleapplyfor_delete",
                "saleapplyfor_create",
              ],
            },
          },
        ],
      },
      // 系统模块
      {
        path: "/sysModule",
        name: "sysModule",
        component: page,
        meta: {
          title: "系统模块",
          icon: "dropbox",
          buttonLimit: [],
        },
        children: [
          {
            path: "/sysModule/system/dicType",
            name: "dicType",
            component: () => import("@/views/sysModule/system/dicType/index"),
            meta: {
              title: "字典类型",
              buttonLimit: [
                "dicType_edit",
                "dicType_details",
                "dicType_delete",
                "dicType_create",
              ],
            },
          },
          {
            path: "/sysModule/system/dic",
            name: "dic",
            component: () => import("@/views/sysModule/system/dic/index"),
            meta: {
              title: "字典值",
              buttonLimit: [
                "dic_edit",
                "dic_details",
                "dic_delete",
                "dic_create",
              ],
            },
          },
          {
            path: "/sysModule/system/codeBuild",
            name: "codeBuild",
            component: () => import("@/views/sysModule/system/codeBuild/index"),
            meta: {
              title: "代码生成",
              buttonLimit: [
                "codeBuild_edit",
                "codeBuild_details",
                "codeBuild_delete",
                "codeBuild_create",
              ],
            },
          },
        ],
      },
    ],
  },
];
